package com.qingcloud.df.executor.config;


import io.minio.MinioClient;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Setter
@Getter
@Configuration
public class MinioConfig {

    @Value("${qingcloud.file-server.oss.endpoint}")
    private String minioUrl;
    @Value("${qingcloud.file-server.oss.accessKey}")
    private String minioName;
    @Value("${qingcloud.file-server.oss.secretKey}")
    private String minioPass;
    @Value("${qingcloud.file-server.oss.region}")
    private String bucketName;
    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(minioUrl)
                .credentials(minioName, minioPass)
                .build();
    }
}
